Electronic devices (for example, a mobile phone, or a music player) use a headset for executing a specific operation, for example, answering a call or listening music. However, the headset manually control the electronic device, for example, a button of the headset is pressed by a user to play music. That is, the electronic device cannot be automatically controlled by the headset. For example, the headset is away from the user, the headset cannot stop playing music for saving power of the electronic device.